package d.z1.common.base;

import d.z1.entity.CustomerInfo;

import java.util.List;

/**
 * 业务层实现类 ， 并调用数据层
 * @param <T>
 */
public abstract class BaseServiceImpl<T> implements IBaseService<T> {

//    获取数据层具体实现类对象，并进行更，删，改，查
    public abstract IBaseDao<T> getIBaseDao()throws Exception;

    public boolean insert(T t) throws Exception {
        return getIBaseDao().insert(t);
    }

    public boolean delete(T t) throws Exception {
        return getIBaseDao().delete(t);
    }

    public boolean update(T t) throws Exception {
        return getIBaseDao().update(t);
    }

    public List<T> selectAll() throws Exception {
        return getIBaseDao().selectAll();
    }

    public T selectId(Integer id) throws Exception {
        return getIBaseDao().selectId(id);
    }
}
